package com.emm.yixun.website.controller.common;

import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.emm.yixun.common.utils.MobileUtil;

/**
 * 手机工具类
 * 
 * @author junze.liu
 * 
 */
@Controller
@RequestMapping("/common/mobile/")
public class MobileUtilController {

	/**
	 * 验证手机号码是否正确
	 * @param mobile
	 * @return flag 0 错误 1正确
	 */
	@RequestMapping("/verifyingMobile")
	@ResponseBody
	public Map<String, String> verifyingMobile(String mobile){
		return MobileUtil.verifying(mobile);
	}
	
	/**
	 * 获取手机号码归属地
	 * @param mobile
	 * @return carrier 归属地
	 */
	@RequestMapping("/mobileCarrier")
	public Map<String, String> mobileCarrier(String mobile){
		return MobileUtil.mobileCarrier(mobile);
	}

}
